﻿<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="/jsp/common/common.jsp"%>
<html>
	<head>	
		<title>装备台账记录</title>
		<script language="javascript" src="<%=contextPath%>/js/func.js"type=""></script>
		<script type="text/javascript" src="<%=contextPath%>/js/validator.js"></script>
		<script type="text/javascript" src="<%=contextPath%>/js/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript" src="<%=contextPath%>/js/jquery.autogrow.js"></script> 
		<script type="text/javascript">
			$(document).ready (function() {
		
			$('textarea').autogrow();		
			});		
			Ext.onReady(function(){
				var tb = new Ext.Toolbar({
			   		renderTo: document.all.tbar,
			    	items: [
				       {
				            text: '保存',
				            icon:"<%=contextPath%>/images/save.gif",
							 hidden:<%=session.getAttribute("btn_add_display") != null || "1".equals(session.getAttribute("SESSION_ISADMIN")) ? false:true%>,	
				            handler:function(){
				            	comt();
				            }
				        },'-',
				        {
				            text: '返回',
				            icon:"<%=contextPath%>/images/fanhui.png",
				            handler:function(){
				            	back();
				            }
				        }
			    	]
			    });
			});
			
			function print(){
			if(document.getElementById("entity.id").value == "0") {
		 	    alert("请先保存装备台账打印机");
		 		return false;
		 	}			
			var url="<%=contextPath%>/cllyjl!initZbtzDetail.do?directFlag=PRINT_SUCCESS&id=${entity.id}";
			 var win = openSUB(url,2,800,600,50,30);
			}
			function getprojectinfo(){
			window.open("<%=contextPath%>/projectImplement!findByUnitno.do", '统计表格', 'height=800, width=350, top=200, left=300, toolbar=no, menubar=no');
			// document.frmM.action = "<%=contextPath%>/projectImplement!findByUnitno";
			}
			
		</script>
	</head>
  
  <body topmargin="0" >
	<div id = "tbar" style="position:absolute;display:block left:0px; top:0px; width:100%; height:35px; z-index:1;"></div>
	<br>
	<div id="Layer" style="position:absolute;display:block left:0px; top:35px; width:100%; height:94%; z-index:1000; overflow:auto;">
	
		<!-- 信息提示 -->
		<div id="result" align="center"><font color="red">${info }</font></div>
		<table width="100%" height="30">
			<tr>
				<td colspan="4" align="center">
					<span  style="font: 22pt/22pt 宋体;"><strong><b>装备台账打印机</b></strong></span>
				</td>
			</tr>
		</table>
 		<form id="frmM" class="ct" name="frmM" method="POST" action="<%=contextPath%>/zbtz!saveZbtz.do">
		<input type="hidden" name="searchBean.con6" id="searchBean.con6" value="${searchBean.con6}" >
 			<s:hidden name="entity.dantype" />	
			<input type="hidden" name="entity.id" id="entity_id" value="${entity.id}"/>
			<input type="hidden" name="entity.fzr" id="entity_fzr" value="${entity.fzr}"/>
			<input type="hidden" name="id"  value="${id}"/>
			<table width="100%" border="0" id="infotab">
			<tr>
                   <th width="120" nowrap>
						<font color="red">*</font>&nbsp;班组：
					</th>
					<td >
						<s:select list="bzList" datatype="Require" name="entity.bzid" width="300" listKey="id" listValue="organName" emptyOption="true" msg="班组必须输入。"/>
					</td>			
			<th width="120" nowrap>
						使用人：
			</th>
			<td>
				<input type="text" style="width:50%" datatype="Require" readonly="true" name="entity.fzrname" value="${entity.fzrname}" msg="使用人必须输入。"/>
				<img style='cursor:pointer' src="<%=contextPath%>/images/editlink.gif" title="" onClick="javascript:getUserselect('entity.fzr','entity.fzrname')" />
			</td>
			
			<th width="120" nowrap>
				<font color="red">*</font>	使用日期：
					</th>
					<td  nowrap>
						<input type="text"  datatype="Require" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('entity.startdate')})" name="entity.startdate" readonly="true" value='<fmt:formatDate value="${entity.startdate}" pattern="yyyy-MM-dd"/>' msg="领用日期必须输入。"/>
						<img onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('entity.startdate')})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
					</td>
			</tr>
			<tr>
			<th align="left" ><font color="red">*</font>设备品牌：</th>
			<td>
			<input type="text"  datatype="Require"  id="sbpp" name="entity.sbpp" value="${entity.sbpp}" msg="设备品牌必须输入。" />
			</td>
			<th align="left" ><font color="red">*</font>型号：</th>
			<td>
			<input type="text"  datatype="Require"  id="xh" name="entity.xh" value="${entity.xh}" msg="型号必须输入。" />
			</td>
			<th align="left" ><font color="red">*</font>序列号</th>
			<td>
			<input type="text"  datatype="Require"  id="xlh" name="entity.xlh" value="${entity.xlh}" msg="序列号必须输入。" />
			</td>
			</tr>			
			<tr>
			<th align="left" ><font color="red">*</font>物理位置</th>
			<td>
			<input type="text"  datatype="Require"  id="wlwz" name="entity.wlwz" value="${entity.wlwz}" msg="物理位置必须输入。" />
			</td>
			<th align="left" ><font color="red">*</font>扫描功能</th>
			<td>
			<input type="text"    id="xs" name="entity.xs" value="${entity.xs}" msg="扫描功能必须输入。" />
			</td>
			<th align="left" ><font color="red">*</font>自动双面</th>
			<td>
			<input type="text"    id="nck" name="entity.nck" value="${entity.nck}" msg="自动双面必须输入。" />
			</td>
			
					
			</tr>		
			<tr>
			<th width="120" nowrap>
				<font color="red">*</font>	出厂日期：
					</th>
					<td  nowrap>
						<input type="text"  datatype="Require" onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('entity.ccdate')})" name="entity.ccdate" readonly="true" value='<fmt:formatDate value="${entity.ccdate}" pattern="yyyy-MM-dd"/>' msg="出厂日期必须输入。"/>
						<img onclick="WdatePicker({dateFmt:'yyyy-MM-dd',el:$dp.$('entity.ccdate')})" src="<%=contextPath%>/js/My97DatePicker/skin/datePicker.gif" width="16" height="22" align="absmiddle">
					</td>
			<th   width="120" nowrap>
						状况：
					</th>
					<td>
						<s:radio name="entity.status"  list="#{'1':'良好','2':'需要更换'}"  listKey="key" listValue="value" />
					</td>
			<th   width="120" nowrap>
						是否在用：
					</th>
					<td>
						<s:radio name="entity.sfzy"  list="#{'1':'在用','2':'停用'}"  listKey="key" listValue="value" />
					</td>
			
			</tr>	
			</table>				
   </form>
   </div>
  </body>
</html>
<script language="javascript">
	
		//删除一行（已有数据）
		function delrow(row,id){
	 
	// window.alert(id);
			if (confirm("确定要删除该条记录吗？")) {
				if(id != 0) {
					Ext.Ajax.request({
						method :'POST',
						url :'zbtz!deleteDetail.do?id=' + id,
						params : {},
						success : function(response, options) {
							var obj = Ext.decode(response.responseText);
							Ext.MessageBox.alert('提示', obj["msg"]);
						
		   					$(row).parents(".repeat").remove();	
	 
						},
						failure : function(response, options) {
							Ext.MessageBox.alert('提示 ', '删除失败。');
						}
					});
				} else {
					$(row).parents(".repeat").remove();	
				}
	 
			}
	 
		} 		
	 // 保存
     function comt(){
        if(!Validator.Validate(frmM,1)){
			return false;
		}
     	document.frmM.action = "<%=contextPath%>/zbtz!saveZbtz.do?directFlag=NEW_SUCCESS";
     	document.frmM.submit();
     }
     
     // 返回
     function back() {
        /**window.parent.window.location.href = "<%=contextPath%>/jsp/business/zbtz/listTabBase.jsp?url=zbtzList!getList.do&searchBean.con20=1&searchBean.con6=1&countPerPage=28&m=m&qxbtn=0";*/
		document.frmM.action = "<%=contextPath%>/zbtzList!getList.do";
		document.frmM.submit();
     }

</script>
